home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / Delete_dopus5 / Delete2.dopus5 next >
Text File  |  1996-06-09  |  2KB  |  84 lines

  1. /* Programm: Delete2.dopus5
  2. ** ------------------------------------------------------------------------------
  3. ** ARexx    DOpus5:ARexx/Delete2.dopus5 {Qp}
  4. ** ------------------------------------------------------------------------------
  5. ** Set all Attribut off.
  6. */
  7.  
  8. parse arg portname
  9. if portname='' then
  10.    portname='DOPUS.1'
  11. address value portname
  12.  
  13. options results
  14. options failat 21
  15. lf='0a'x
  16.  
  17. if ~show('l','rexxsupport.library') then
  18.     call addlib('rexxsupport.library',0,-30,0)
  19.  
  20. /* init locale */
  21. if ~show(l,'locale.library') then
  22.         call addlib('locale.library',0,-30)
  23. if show(l,'locale.library') then
  24.         catalog=opencatalog('Delete2.catalog','deutsch',0)
  25. lister query source
  26.  
  27. if rc>0 then do
  28.    dopus front
  29.    dopus request '"'getcatstr(0,'Error:'lf'Kein Quellverzeichnis gewählt')'"' getcatstr(1,'Ende')
  30.    exit
  31. end
  32.  
  33. parse var result handle 
  34.  
  35. lister query handle numselfiles
  36. if result=0 then do
  37.      dopus front
  38.      dopus request '"'getcatstr(1,'Error:'lf'Keine Einträge selektiert')'"' getcatstr(1,'Ende')
  39.      exit
  40. end
  41.      dopus front
  42.      dopus request '"'getcatstr(2,'Warnung:'lf'Jede 2.Datei wird gelöscht.')'"' getcatstr(1,'OK|Abbruch')
  43.      If DOPUSRC=0 then exit
  44.  
  45. lister set handle busy on
  46. lister query handle path
  47. QuellPfad=result
  48.  
  49. lister query handle selfiles stem files.
  50. lister set handle progress files.count getcatstr(3,'Lösche Dateien ...')
  51. lister refresh handle full  
  52.  
  53. J=1
  54. do i=0 to files.count-1
  55.    lister query handle abort
  56.    if result then do
  57.     test=0
  58.     leave
  59.     end
  60.    lister set handle progress count i+1
  61.    lister set handle progress name files.i
  62.    Titel=Quellpfad||files.i
  63.    j=j+1
  64.    If J>2 then do
  65.        j=1
  66.        address command "DELETE >NIL: "||'"'Titel'"'
  67.    end
  68.    lister select handle '"'files.i'"' off
  69. end
  70. lister refresh handle full
  71. lister set handle busy off
  72. Exit
  73. /*--------------------------------------------------------------------------------*/
  74. getcatstr:
  75.    parse arg msgno,msgstring,insert.1,insert.2
  76.    if catalog~=0 then msgstring=getcatalogstr(catalog,msgno,msgstring)
  77.    j=0
  78.    do while pos('%s',msgstring)>0
  79.       parse var msgstring fore '%s' aft
  80.       j=j+1
  81.       msgstring=fore||insert.j||aft
  82.       end
  83.    return msgstring
  84.